package com.tuanzi.loan.business.service.credit.impl;

import com.tuanzi.loan.business.repository.credit.LoanCreditOrderRepository;
import com.tuanzi.loan.business.service.credit.LoanCreditOrderService;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.credit.LoanCreditOrderRequest;
import com.tuanzi.loan.vo.response.credit.LoanCreditOrderResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.retry.RetryException;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * User: liangZongXi
 * Create time: 11:25 2019/9/17
 * Description:
 */
@Debug
@Service
@Transactional
@Retryable(value = { RetryException.class })
public class LoanCreditOrderServiceImpl implements LoanCreditOrderService {

    @Autowired
    private LoanCreditOrderRepository loanCreditOrderRepository;

    @Override
    public Page<LoanCreditOrderResponse> listOrder(PageSearcher<LoanCreditOrderRequest> pageSearcher) {
        return loanCreditOrderRepository.list(pageSearcher.getSearchCondition(), pageSearcher.getPageable());
    }
}
